﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Controls;
using System.Windows;
using InteControlSys.ViewModel;
namespace InteControlSys.Template
{
    public class OpDetailTemplateSelector : DataTemplateSelector
    {
        public override DataTemplate SelectTemplate(object item, DependencyObject container)
        {
            DataTemplate template = null;
            FrameworkElement element = container as FrameworkElement;
            if (item is NoRecordViewModel)
            {
                template = element.FindResource("NoRecord") as DataTemplate;
            }
            else if (item is NotArrivedViewModel)
            {
                template = element.FindResource("NotArrived") as DataTemplate;
            }
            else if (item is ArriveNodeViewModel)
            {
                template = element.FindResource("ArriveNode") as DataTemplate;
            }
            else if (item is WaitForReceiveViewModel)
            {
                template = element.FindResource("WaitForReceive") as DataTemplate;
            }
            else if (item is WaitingForDriverReplyViewModel)
            {
                template = element.FindResource("WaitingForDriverReply") as DataTemplate;
            }
            else if (item is WaitingForScrapAdmissionViewModel)
            {
                template = element.FindResource("WaitingForScrapAdmission") as DataTemplate;
            }
            else if (item is ReadyToExitParkingLotViewModel)
            {
                template = element.FindResource("ReadyToExitParkingLot") as DataTemplate;
            }
            else if (item is ReadyToEnterScrapYardViewModel)
            {
                template = element.FindResource("ReadyToEnterScrapYard") as DataTemplate;
            }
            else if (item is WaitingForAllocationViewModel)
            {
                template = element.FindResource("WaitingForAllocation") as DataTemplate;
            }
            else if (item is CallNodeViewModel)
            {
                template = element.FindResource("CallNode") as DataTemplate;
            }
            else if (item is FirstCheckNodeViewModel)
            {
                template = element.FindResource("FirstCheck") as DataTemplate;
            }
            else if (item is EnteringNodeViewModel)
            {
                template = element.FindResource("EnteringNode") as DataTemplate;
            }
            else if (item is FirstWeighingNodeViewModel)
            {
                template = element.FindResource("FirstWeighing") as DataTemplate;
            }
            else if (item is GoFeildNodeViewModel)
            {
                template = element.FindResource("GoFeild") as DataTemplate;
            }
            else if (item is GoSampleNodeViewModel)
            {
                template = element.FindResource("GoSample") as DataTemplate;
            }
            else if (item is SamplingNodeViewModel)
            {
                template = element.FindResource("Sampling") as DataTemplate;
            }
            else if (item is SampledNodeViewModel)
            {
                template = element.FindResource("Sampled") as DataTemplate;
            }
            else if (item is UnloadingNodeViewModel)
            {
                template = element.FindResource("Unloading") as DataTemplate;
            }
            else if (item is UnloadedNodeViewModel)
            {
                template = element.FindResource("UnloadedOpDetail") as DataTemplate;
            }
            else if (item is SecondWeighingNodeViewModel)
            {
                template = element.FindResource("SecondWeighing") as DataTemplate;
            }
            else if (item is LeavingNodeViewModel)
            {
                template = element.FindResource("Leaving") as DataTemplate;
            }
            else if (item is FilingNodeViewModel)
            {
                template = element.FindResource("FilingOpDetail") as DataTemplate;
            }
            else if (item is FiledNodeViewModel)
            {
                template = element.FindResource("FiledOpDetail") as DataTemplate;
            }
            return template;
        }
    }
}
